public class Date {
    public int year;
    public int month;
    public int day;

    public void setDay(int year, int month, int day){
        //相当于一个方法
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void print(){
        System.out.println("year:" + this.year + " month:" + this.month + " day" + this.day);
    }

    public static void main(String[] args) {
        Date date = new Date();
        //date.day = 11; 我们先不进行这样赋值
        date.setDay(1999,1,11);
        date.print();
        Date date1 = new Date();
        date1.setDay(1899,2,3);
        date1.print();
    }
}
